package com.prs.crm.action.crm;

import java.io.File;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.courser.struts.BaseAction;
import org.courser.ui.PaginationSupport;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.context.AppContext;
import com.prs.crm.context.Attach;
import com.prs.crm.context.Constrains;
import com.prs.crm.context.FileUtil;
import com.prs.crm.domain.crm.CodeNumber;
import com.prs.crm.domain.crm.Customer;
import com.prs.crm.domain.crm.CustomerAddress;
import com.prs.crm.domain.crm.CustomerContract;
import com.prs.crm.domain.crm.CustomerLevel;
import com.prs.crm.domain.crm.CustomerSource;
import com.prs.crm.domain.crm.CustomerSupplier;
import com.prs.crm.domain.crm.CustomerTrade;
import com.prs.crm.domain.crm.DocumenTary;
import com.prs.crm.domain.crm.DocumenTaryStyle;
import com.prs.crm.domain.crm.Linkman;
import com.prs.crm.domain.crm.SupplierFoods;
import com.prs.crm.domain.hr.Person;
import com.prs.crm.service.crm.CodeNumberService;
import com.prs.crm.service.crm.CustomerAddressService;
import com.prs.crm.service.crm.CustomerContractService;
import com.prs.crm.service.crm.CustomerService;
import com.prs.crm.service.crm.CustomerSourceService;
import com.prs.crm.service.crm.CustomerSupplierService;
import com.prs.crm.service.crm.CustomerTradeService;
import com.prs.crm.service.crm.DocumenTaryService;
import com.prs.crm.service.crm.DocumenTaryStyleService;
import com.prs.crm.service.crm.LinkmanService;
import com.prs.crm.service.crm.SupplierFoodsService;

public class CustomerSupplierAction extends BaseAction{
	private static final long serialVersionUID = 1L;
	
	private CustomerSupplier customerSupplier;
	private CustomerContract customerContract;
	private CustomerContractService customerContractService;
	private Integer[] supplierIds;
	private Integer[] foodIds;
	private Integer[] contractIds;
	private PaginationSupport pagination;
	private CustomerSupplierService customerSupplierService;
	private CodeNumber codeNumber;
	private CodeNumberService codeNumberService;
	private File upload;
	private String uplodS;
	private String uploadFileName;
	
	private List<CustomerTrade> trades;
	private CustomerTradeService customerTradeService;
	private List<CustomerAddress> addresses;
	private CustomerAddressService customerAddressService;
	private List<Customer> customers;  
	private CustomerService customerService;
	private List<Linkman> linkmans;
	private LinkmanService linkmanService;
	private Linkman linkman;
	private List<DocumenTary> tarys;
	private DocumenTaryService documenTaryService;
	private DocumenTary documenTary;
	private List<CustomerSource> sources;
	private CustomerSourceService customerSourceService;
	private List<DocumenTaryStyle> styles;
	private DocumenTaryStyleService documenTaryStyleService;
	
	private SupplierFoods supplierFoods;
	private List<SupplierFoods> foodes;
	private SupplierFoodsService supplierFoodsService;
	//货物信息
	private String[] foodName;
	private String[] modelstyle;
	private Double[] price;
	private Integer[] nums;
	//要删除货物的Id
	private Integer[] conFoodIds;
	//默认值设置
	private String value;
	private String key;
	private String valueTrade;
	private String keyTrade;
	private String valueSource;
	private String keySource;
	
	@Action("selectCustomerSupplier")
	public String selectCustomerSupplier() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				CustomerSupplier.class);
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.getCustomerSupplierService().listByPage(criteria,
				pagination));
		return SUCCESS;
	}
	@Action("selectCustomerSupplier2")
	public String selectCustomerSupplier2() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				CustomerSupplier.class);
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.getCustomerSupplierService().listByPage(criteria,
				pagination));
		return SUCCESS;
	}
	@Action("listCustomerSupplier")
	public String listCustomerSupplier(){
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				CustomerSupplier.class);
		criteria.add(Restrictions.or(Restrictions.like("shareperson","%"+AppContext.getAccountContext().currentUser().getResume().getName()+"%"), Restrictions.like("person", "%"+AppContext.getAccountContext().currentUser().getResume().getName()+"%")));
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.getCustomerSupplierService().listByPage(criteria,
				pagination));
		return SUCCESS;
	}
	@Action("editFoods")
	public String editFoods(){
		if(foodIds!=null){
			this.supplierFoods=this.supplierFoodsService.get(foodIds[0]);
		}
		return SUCCESS;
	}
	@Action("editDocumenTaryBySupplier")
	public String editDocumenTaryBySupplier(){
		if(supplierIds!=null){
			this.customerSupplier=this.customerSupplierService.get(supplierIds[0]);
		}
		this.styles=this.documenTaryStyleService.getAllStyles();
		return SUCCESS;
	}
	@Action("editLinkmanByGY")
	public String editLinkmanByGY(){
		if(supplierIds!=null){
			this.customerSupplier=this.customerSupplierService.get(supplierIds[0]);
		}
		return SUCCESS;
	}
	@Action(value = "savefoods", results = {
			@Result(name = "success", type = "redirect", location = "listSupplierFoods"),
			@Result(name = "error", type = "chain", location = "editFoods")})
	public String savefoods(){
		if(supplierFoods.getId()==null){
			supplierFoods.setCustomerSupplier(customerSupplier);
			Double allprice=supplierFoods.getPrice()*supplierFoods.getNums();
			supplierFoods.setAllprice(String.valueOf(allprice));
			this.supplierFoodsService.save(supplierFoods);
		}else{
			supplierFoods.setCustomerSupplier(customerSupplier);
			Double allprice=supplierFoods.getPrice()*supplierFoods.getNums();
			supplierFoods.setAllprice(String.valueOf(allprice));
			this.supplierFoodsService.submit(supplierFoods);
		}
		return SUCCESS;
	}
	@Action(value = "saveDocumenTarySu", results = {
			@Result(name = "success", type = "redirect", location = "listCustomerSupplier"),
			@Result(name = "error", type = "chain", location = "editDocumenTaryBySupplier")})
	public String saveDocumenTarySu(){
		this.documenTary.setCustomerSupplier(customerSupplier);
		this.documenTaryService.save(documenTary);
		return SUCCESS;
	}
	@Action(value = "saveDocumenTarySu2", results = {
			@Result(name = "success", type = "redirect", location = "viewCustomerSupplier?customerSupplier=${customerSupplier.getId()}"),
			@Result(name = "error", type = "chain", location = "editDocumenTaryBySupplier")})
	public String saveDocumenTarySu2(){
		this.documenTary.setCustomerSupplier(customerSupplier);
		this.documenTaryService.save(documenTary);
		return SUCCESS;
	}
	@Action(value = "saveLinkmanGY", results = {
			@Result(name = "success", type = "redirect", location = "listCustomerSupplier"),
			@Result(name = "error", type = "chain", location = "editLinkmanByGY")})
	public String saveLinkmanGY(){
		this.linkman.setCustomerSupplier(customerSupplier);
		this.linkmanService.save(linkman);
		return SUCCESS;
	}
	@Action(value = "saveLinkmanGY2", results = {
			@Result(name = "success", type = "redirect", location = "viewCustomerSupplier?customerSupplier=${customerSupplier.getId()}"),
			@Result(name = "error", type = "chain", location = "editLinkmanByGY")})
	public String saveLinkmanGY2(){
		this.linkman.setCustomerSupplier(customerSupplier);
		this.linkmanService.save(linkman);
		return SUCCESS;
	}
	@Action(value = "removeContract", results = {
			@Result(name = "success", type = "redirect", location = "viewContracts"),
			@Result(name = "error", type = "chain", location = "viewContracts")})
	public String removeContract(){
		for(int i=0;i<contractIds.length;i++){
			CustomerContract con=this.customerContractService.get(contractIds[i]);
			//查询货物
			List<SupplierFoods> foods=this.supplierFoodsService.getSupplierFoodsByCustomerContract(con);
			if(foods!=null){
				for(SupplierFoods food:foods){
					this.supplierFoodsService.remove(food);
				}
			}
			this.customerContractService.remove(con);
		}
		return SUCCESS;
	}
	@Action("viewFoods")
	public String viewFoods(){
		if(supplierIds!=null){
			this.customerSupplier=this.customerSupplierService.get(supplierIds[0]);
		}
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				SupplierFoods.class);
		criteria.add(Restrictions.eq("customerSupplier", customerSupplier));
		Person per = AppContext.getAccountContext().currentUser();
		criteria.createAlias("recorder", "rd");
		criteria.add(Restrictions.or(Restrictions.like("sharePerson","%"+per.getResume().getName()+"%"), Restrictions.like("person","%"+per.getResume().getName()+"%")));
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.getCustomerSupplierService().listByPage(criteria,
				pagination));
		return SUCCESS;
	}
	@Action("viewContracts")
	public String viewContracts(){
		if(supplierIds!=null){
			this.customerSupplier=this.customerSupplierService.get(supplierIds[0]);
		}
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				CustomerContract.class);
		criteria.add(Restrictions.eq("customerSupplier", customerSupplier));
		criteria.add(Restrictions.or(Restrictions.like("sharePerson","%"+AppContext.getAccountContext().currentUser().getResume().getName()+"%"), Restrictions.like("siningPerson", "%"+AppContext.getAccountContext().currentUser().getResume().getName()+"%")));
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.getCustomerSupplierService().listByPage(criteria,
				pagination));
		return SUCCESS;
	}
	@Action("viewFood")
	public String viewFood(){
		if(foodIds!=null){
			this.supplierFoods=this.supplierFoodsService.get(foodIds[0]);
		}
		return SUCCESS;
	}
	@Action("editContract")
	public String editContract(){
		if(contractIds!=null){
			this.customerContract=this.customerContractService.get(contractIds[0]);
		}
		this.foodes=this.supplierFoodsService.getSupplierFoodsByCustomerContract(customerContract);
		
		return SUCCESS;
	}
	@Action(value = "saveContract", results = {
			@Result(name = "success", type = "redirect", location = "viewContracts?customerSupplier=${customerSupplier.getId()}"),
			@Result(name = "error", type = "chain", location = "editContract")})
	public String saveContract(){
		if(customerContract.getId()==null){
			customerContract.setCustomerSupplier(customerSupplier);
			this.customerContractService.save(customerContract);
		}else{
			customerContract.setCustomerSupplier(customerSupplier);
			this.customerContractService.submit(customerContract);
		}
		Double conprice=0.00; //合同总额
		Double foodprice=0.00;  //合同总额要减少的数量
		Double allprice=0.0;
		//要删除的货物
		if(this.conFoodIds!=null){
			//计算删除的货物后合同总额要减少多少
			for(int i=0;i<conFoodIds.length;i++){
				SupplierFoods f=this.supplierFoodsService.get(conFoodIds[i]);
				foodprice=foodprice+Double.parseDouble(f.getAllprice());
			}
			this.supplierFoodsService.batchRemove(conFoodIds);
		}
		//采购货物
		if(this.foodName!=null){
			SupplierFoods food=null;
			for(int i=0;i<foodName.length;i++){
				if(foodName[i]==null || foodName[i].equals("")){
					addActionError("请将货物信息中的货物名称填写完");
					return ERROR;
				}
				else{
					food=new SupplierFoods();
					food.setFoodName(foodName[i]);
					food.setModelstyle(modelstyle[i]);
						if(price[i]==null || price[i].equals("")){
							food.setPrice(0.00);
						}else{
							food.setPrice(price[i]);
						}
					if(nums[i]==null || nums[i].equals("")){
						food.setNums(0);
					}else{
						food.setNums(nums[i]);
					}
					allprice=price[i]*nums[i];
					conprice=conprice+allprice; //计算合同总额
					food.setAllprice(String.valueOf(allprice));		
					food.setCustomerContract(customerContract);
					food.setCustomerSupplier(customerSupplier);
					food.setFoodday(new Date());
					this.supplierFoodsService.save(food);
					customerContract.setAllContractPrice(String.valueOf(allprice));
				}
			}
		}
		//合同	
		if(foodprice!=0.00){
			Double aac=Double.parseDouble(customerContract.getAllContractPrice())-foodprice; //减少货物合同总额减少
			customerContract.setAllContractPrice(String.valueOf(aac));
		}
		if(conprice!=0.00){
			Double bb=Double.parseDouble(customerContract.getAllContractPrice())+conprice;
			customerContract.setAllContractPrice(String.valueOf(bb)); //添加货物合同总额增加
		}
		//计算未付款
		Double wprice=Double.parseDouble(customerContract.getAllContractPrice())-Double.parseDouble(customerContract.getYprice());
		customerContract.setWprice(String.valueOf(wprice));
		customerContract.setCustomerSupplier(customerSupplier);
		this.getCustomerContractService().submit(customerContract);
		return SUCCESS;
	}
	@Action("viewContract")
	public String viewContract(){
		this.customerContract=this.customerContractService.get(contractIds[0]);
		this.foodes=this.supplierFoodsService.getSupplierFoodsByCustomerContract(customerContract);
		return SUCCESS;
	}
	@Action(value = "removeFood", results = {
			@Result(name = "success", type = "redirect", location = "viewFoods"),
			@Result(name = "error", type = "chain", location = "viewFoods")})
	public String removeFood(){
		this.supplierFoodsService.batchRemove(foodIds);
		return SUCCESS;
	}
	@Action("editCustomerSupplier")
	public String eidtCustomerSupplier(){
		if(this.supplierIds!=null){
			this.customerSupplier=this.customerSupplierService.get(supplierIds[0]);
		}else{
			this.codeNumber=this.codeNumberService.getCodeByState("供应商");
		}
		this.addresses=this.customerAddressService.getalladdress();
		//设置默认值
		if(customerSupplier==null){
		for(int i=0;i<addresses.size();i++){
			CustomerAddress ad=addresses.get(i);
			if(ad.getRemark()!=null){
				this.value=ad.getName();
				this.key=ad.getId().toString();
				addresses.remove(ad);
			}
		}}
		this.trades = this.getCustomerTradeService().getAllCustomerTrade();
		if(customerSupplier==null){
			for(int i=0;i<trades.size();i++){
				CustomerTrade t=trades.get(i);
				if(t.getRemark()!=null){
					this.valueTrade=t.getName();
					this.keyTrade=t.getId().toString();
					trades.remove(t);
				}
			}
		}
		this.sources=this.customerSourceService.getAllSources();
		if(customerSupplier==null){
			for(int i=0;i<sources.size();i++){
				CustomerSource s=sources.get(i);
				if(s.getRemark()!=null){
					this.valueSource=s.getName();
					this.keySource=s.getId().toString();
					sources.remove(s);
				}
			}
		}
		return SUCCESS;
	}
	@Action("viewCustomerSupplier")
	public String viewCustomerSupplier(){
		if(supplierIds!=null){
			this.customerSupplier=this.customerSupplierService.get(supplierIds[0]);
		}
		this.customers=this.customerService.getCustomerBySupplier(customerSupplier);
		this.linkmans=this.linkmanService.getLinkmanByCustomerSupplier(customerSupplier);
		this.tarys=this.documenTaryService.getDocumenTaryBySupplier(customerSupplier);
		return SUCCESS;
	}
	@Action(value = "removeCustomerSupplier", results = {
			@Result(name = "success", type = "redirect", location = "listCustomerContract"),
			@Result(name = "error", type = "chain", location = "editCustomerSupplier")})
	public String remove(){
		for(int i=0;i<supplierIds.length;i++){
			CustomerSupplier sup=this.customerSupplierService.get(supplierIds[i]);
			//查询供应商关联客户
			List<Customer> cuss=this.customerService.getCustomerBySupplier(sup);
			if(cuss!=null){
				for(Customer cus:cuss){
					customerService.remove(cus);
				}
			}
			//查询供应商关联联系人
			List<Linkman> lins=this.linkmanService.getLinkmanByCustomerSupplier(sup);
			if(lins!=null){
				for(Linkman lin:lins){
					this.linkmanService.remove(lin);
				}
			}
			//查询供应商关联跟单
			List<DocumenTary> docs=this.documenTaryService.getDocumenTaryBySupplier(sup);
			if(docs!=null){
				for(DocumenTary doc:docs){
					this.documenTaryService.remove(doc);
				}
			}
			//查询供应商货物
			List<SupplierFoods> foods=this.supplierFoodsService.getSupplierFoodsByCustomerSupplier(sup);
			if(foods!=null){
				for(SupplierFoods food:foods){
					supplierFoodsService.remove(food);
				}
			}
			//查询供应商合同
			List<CustomerContract> cons=this.customerContractService.getContractByCustomerSupplier(sup);
			if(cons!=null){
				for(CustomerContract con:cons){
					this.customerContractService.remove(con);
				}
			}
			this.customerSupplierService.remove(sup);
		}
		return SUCCESS;
	}
	@Action(value = "saveCustomerSupplier", results = {
			@Result(name = "success", type = "redirect", location = "listCustomerSupplier"),
			@Result(name = "error", type = "chain", location = "editCustomerSupplier")})
	public String saveCustomerSupplier(){
		if(customerSupplier.getId()!=null){
			upload=new File(uplodS);
			if(upload!=null){
			Attach cAttach=FileUtil.getInstance().saveFile(upload, uploadFileName,"",Constrains.UPLOAD_DIR_CUSTOMER);
			if(cAttach.getSrc()!=null){
				customerSupplier.setCustomerSupplier_file(cAttach.getSrc());
			}
			}
			this.customerSupplierService.save(customerSupplier);
			//编号
			String edit=this.codeNumber.getEdit();
			String sample=this.codeNumber.getSample();
			String[] ee=edit.split(",");
			String[] ss=sample.split(",");
			List<String> list=new ArrayList<String>();
			for(int i=0;i<ee.length;i++){
				String samp="";
				if(ee[i].equals("##")){
					int bb=Integer.parseInt(ss[i]);
					bb=bb+1;
					String b="";
					for(int a=0;a<ss[i].length()-String.valueOf(bb).length();a++){
						b=b+"0";
					}
					samp=b+bb;
					ss[i]=samp;
				}
				if(i==ee.length-1){
					list.add(ss[i]);
				}else{
					list.add(ss[i]+",");
				}
			}
			String d="";
			String q="";
			for(int i=0;i<list.size();i++){
				d=d+list.get(i);
			}
			String[] dd=d.split(",");
			for(int i=0;i<dd.length;i++){
				q=q+dd[i];
			}
			this.codeNumber.setSample(d);
			this.codeNumber.setCodeSample(q);
			int now=Integer.parseInt(codeNumber.getNowCode())+1;
			this.codeNumber.setNowCode(String.valueOf(now));
			this.codeNumberService.submit(codeNumber);
		}else{
			this.customerSupplierService.submit(customerSupplier);
		}
		return SUCCESS;
	}
	public PaginationSupport getPagination() {
		return pagination;
	}

	public void setPagination(PaginationSupport pagination) {
		this.pagination = pagination;
	}

	public CustomerSupplierService getCustomerSupplierService() {
		return customerSupplierService;
	}

	public void setCustomerSupplierService(
			CustomerSupplierService customerSupplierService) {
		this.customerSupplierService = customerSupplierService;
	}

	public CustomerSupplier getCustomerSupplier() {
		return customerSupplier;
	}

	public void setCustomerSupplier(CustomerSupplier customerSupplier) {
		this.customerSupplier = customerSupplier;
	}
	public List<CustomerTrade> getTrades() {
		return trades;
	}
	public void setTrades(List<CustomerTrade> trades) {
		this.trades = trades;
	}
	public CustomerTradeService getCustomerTradeService() {
		return customerTradeService;
	}
	public void setCustomerTradeService(CustomerTradeService customerTradeService) {
		this.customerTradeService = customerTradeService;
	}
	public Integer[] getSupplierIds() {
		return supplierIds;
	}
	public void setSupplierIds(Integer[] supplierIds) {
		this.supplierIds = supplierIds;
	}
	public List<Customer> getCustomers() {
		return customers;
	}
	public void setCustomers(List<Customer> customers) {
		this.customers = customers;
	}
	public CustomerService getCustomerService() {
		return customerService;
	}
	public void setCustomerService(CustomerService customerService) {
		this.customerService = customerService;
	}
	public List<Linkman> getLinkmans() {
		return linkmans;
	}
	public void setLinkmans(List<Linkman> linkmans) {
		this.linkmans = linkmans;
	}
	public LinkmanService getLinkmanService() {
		return linkmanService;
	}
	public void setLinkmanService(LinkmanService linkmanService) {
		this.linkmanService = linkmanService;
	}
	public List<DocumenTary> getTarys() {
		return tarys;
	}
	public void setTarys(List<DocumenTary> tarys) {
		this.tarys = tarys;
	}
	public DocumenTaryService getDocumenTaryService() {
		return documenTaryService;
	}
	public void setDocumenTaryService(DocumenTaryService documenTaryService) {
		this.documenTaryService = documenTaryService;
	}
	public SupplierFoods getSupplierFoods() {
		return supplierFoods;
	}
	public void setSupplierFoods(SupplierFoods supplierFoods) {
		this.supplierFoods = supplierFoods;
	}
	public SupplierFoodsService getSupplierFoodsService() {
		return supplierFoodsService;
	}
	public void setSupplierFoodsService(SupplierFoodsService supplierFoodsService) {
		this.supplierFoodsService = supplierFoodsService;
	}
	public Integer[] getFoodIds() {
		return foodIds;
	}
	public void setFoodIds(Integer[] foodIds) {
		this.foodIds = foodIds;
	}
	public CustomerContract getCustomerContract() {
		return customerContract;
	}
	public void setCustomerContract(CustomerContract customerContract) {
		this.customerContract = customerContract;
	}
	public CustomerContractService getCustomerContractService() {
		return customerContractService;
	}
	public void setCustomerContractService(
			CustomerContractService customerContractService) {
		this.customerContractService = customerContractService;
	}
	public Integer[] getContractIds() {
		return contractIds;
	}
	public void setContractIds(Integer[] contractIds) {
		this.contractIds = contractIds;
	}
	public List<SupplierFoods> getFoodes() {
		return foodes;
	}
	public void setFoodes(List<SupplierFoods> foodes) {
		this.foodes = foodes;
	}
	public DocumenTary getDocumenTary() {
		return documenTary;
	}
	public void setDocumenTary(DocumenTary documenTary) {
		this.documenTary = documenTary;
	}
	public Linkman getLinkman() {
		return linkman;
	}
	public void setLinkman(Linkman linkman) {
		this.linkman = linkman;
	}
	public String[] getFoodName() {
		return foodName;
	}
	public void setFoodName(String[] foodName) {
		this.foodName = foodName;
	}
	public String[] getModelstyle() {
		return modelstyle;
	}
	public void setModelstyle(String[] modelstyle) {
		this.modelstyle = modelstyle;
	}

	public Double[] getPrice() {
		return price;
	}
	public void setPrice(Double[] price) {
		this.price = price;
	}
	public Integer[] getNums() {
		return nums;
	}
	public void setNums(Integer[] nums) {
		this.nums = nums;
	}
	public List<CustomerAddress> getAddresses() {
		return addresses;
	}
	public void setAddresses(List<CustomerAddress> addresses) {
		this.addresses = addresses;
	}
	public CustomerAddressService getCustomerAddressService() {
		return customerAddressService;
	}
	public void setCustomerAddressService(
			CustomerAddressService customerAddressService) {
		this.customerAddressService = customerAddressService;
	}
	public List<CustomerSource> getSources() {
		return sources;
	}
	public void setSources(List<CustomerSource> sources) {
		this.sources = sources;
	}
	public CustomerSourceService getCustomerSourceService() {
		return customerSourceService;
	}
	public void setCustomerSourceService(CustomerSourceService customerSourceService) {
		this.customerSourceService = customerSourceService;
	}
	public List<DocumenTaryStyle> getStyles() {
		return styles;
	}
	public void setStyles(List<DocumenTaryStyle> styles) {
		this.styles = styles;
	}
	public DocumenTaryStyleService getDocumenTaryStyleService() {
		return documenTaryStyleService;
	}
	public void setDocumenTaryStyleService(
			DocumenTaryStyleService documenTaryStyleService) {
		this.documenTaryStyleService = documenTaryStyleService;
	}
	public Integer[] getConFoodIds() {
		return conFoodIds;
	}
	public void setConFoodIds(Integer[] conFoodIds) {
		this.conFoodIds = conFoodIds;
	}
	public CodeNumber getCodeNumber() {
		return codeNumber;
	}
	public void setCodeNumber(CodeNumber codeNumber) {
		this.codeNumber = codeNumber;
	}
	public CodeNumberService getCodeNumberService() {
		return codeNumberService;
	}
	public void setCodeNumberService(CodeNumberService codeNumberService) {
		this.codeNumberService = codeNumberService;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	public String getKey() {
		return key;
	}
	public void setKey(String key) {
		this.key = key;
	}
	public String getValueTrade() {
		return valueTrade;
	}
	public void setValueTrade(String valueTrade) {
		this.valueTrade = valueTrade;
	}
	public String getKeyTrade() {
		return keyTrade;
	}
	public void setKeyTrade(String keyTrade) {
		this.keyTrade = keyTrade;
	}
	public String getValueSource() {
		return valueSource;
	}
	public void setValueSource(String valueSource) {
		this.valueSource = valueSource;
	}
	public String getKeySource() {
		return keySource;
	}
	public void setKeySource(String keySource) {
		this.keySource = keySource;
	}
	public File getUpload() {
		return upload;
	}
	public void setUpload(File upload) {
		this.upload = upload;
	}
	public String getUplodS() {
		return uplodS;
	}
	public void setUplodS(String uplodS) {
		this.uplodS = uplodS;
	}
	public String getUploadFileName() {
		return uploadFileName;
	}
	public void setUploadFileName(String uploadFileName) {
		this.uploadFileName = uploadFileName;
	}
	
}
